package com.example.administrator.School.fragment;


import android.content.Intent;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.example.administrator.School.DetailActivity;
import com.example.administrator.School.KcbActivity;
import com.example.administrator.School.R;
import com.example.administrator.School.adpter.HorizontalListView;
import com.example.administrator.School.until.BaseFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 课程表的fragment
 */
public class kcFragment extends BaseFragment {

    public ListView listview;
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_kc;
    }
    @Override
    protected void initWidget(View root) {
        super.initWidget(root);
        listview = (ListView) root.findViewById(R.id.list_view);
        String[] str = {"1.上海","北京","天津","江苏","河南","西藏","新疆","湖南","湖北"};
        List<String> listdata = new ArrayList<String>();
        listdata.add("1.语文 7.30-8.10");
        listdata.add("2.语文 7.30-8.10");
        listdata.add("3.语文 7.30-8.10");
        listdata.add("4.语文 7.30-8.10");
        listdata.add("");
        listdata.add("5.语文 7.30-8.10");
        listdata.add("6.语文 7.30-8.10");
        listdata.add("7.语文 7.30-8.10");
        listdata.add("");
        listdata.add("");
        ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getContext(),R.layout.list_item,listdata);//listdata和str均可
        listview.setAdapter(arrayAdapter);
    }
    //进入课程表详情页面
    @OnClick(R.id.detail)
    void detail(){
        startActivity(new Intent(getContext(), KcbActivity.class));
    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }


}
